<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>支付｜局域网精灵</title>
    <link rel="stylesheet" href="res/css/spectre.min.css">
    <link rel="stylesheet" href="res/css/app.css">
    <script>
        function doCopyUsername(me) {
            var beforeText = me.innerText;
            var elem = document.getElementById('username');
            elem.removeAttribute('disabled');
            elem.select();
            document.execCommand('Copy');
            me.innerText = 'OK'
            setTimeout(() => {
                elem.setAttribute('disabled', 'disabled')
                me.innerText = beforeText;
            }, 1000);
        }
        </script>
</head>

<body>
    <div id="app" class="column">
        <div class="waterfall">
            <div>立即支付</div>
            <h3>
                <b style="color:red">！支付时请一定记得备注您的用户名！</b>
            </h3>
            <div id="username-box" style="display:none"><input type="text" id="username" disabled> <button id="copy-btn"
                    onclick="doCopyUsername(this)">复制我的用户名</button></div><a
                href="https://qr.alipay.com/tsx02907mtbanqhpid1vq87"><img src="https://lan-genius.com/res/image/alipay.jpg"
                    alt="alipay"></a><span>微信支付无法退款，有问题请加售后Q群:691017244</span> <a
                href="wxp://f2f0p_qNyNEd6TdLm6DBIb9PWiHFsP7ZkmN8"><img src="https://lan-genius.com/res/image/wechat.jpg"
                    alt="wechat"></a><br><a href="https://www.paypal.me/stevenzack"><img src="https://lan-genius.com/res/image/paypal.jpg"
                    alt="paypal"></a><span>充值将在一个工作日内完成</span> <span>售后QQ群: 929418739</span> <a
                href="contact.html">联系方式</a>
        </div>
    </div>
    <script>
        function subBefore(s, sep, def) {
            for (var i = 0; i <= s.length - sep.length; i++) {
                if (s.substring(i, i + sep.length) == sep) {
                    return s.substring(0, i)
                }
            }
            return def
        }

        function subAfter(s, sep, def) {
            for (var i = 0; i <= s.length - sep.length; i++) {
                if (s.substring(i, i + sep.length) == sep) {
                    return s.substring(i + sep.length)
                }
            }
            return def
        }
        function parseQuery(url) {
            var m = {};
            var query = subAfter(url, '?', '');
            if (query == '') {
                return m;
            }
            var pairs = query.split('&');
            for (var i = 0; i < pairs.length; i++) {
                var pair = pairs[i]
                var key = subBefore(pair, '=', '');
                if (key == '') {
                    continue
                }
                key = decodeURIComponent(key);

                var value = subAfter(pair, '=', '');
                if (value == '') {
                    continue
                }
                value = decodeURIComponent(value)
                m[key] = value
            }
            return m;
        }
        var obj = parseQuery(location.href);
        if (obj['username']) {
            document.getElementById('username').value = decodeURIComponent(obj['username'])
            document.getElementById('username-box').style.display = 'block'
        }
    </script>
</body>

</html>